﻿<Window x:Class="CPPEI.Coolzon.DisplayApp.Windows.SettingWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
       xmlns:ui="clr-namespace:CPPEI.Coolzon.UI;assembly=CPPEI.Coolzon.UI"
         xmlns:convert="clr-namespace:CPPEI.Coolzon.DisplayApp"
        Title="设置" Height="300" Width="600"
        WindowStyle="SingleBorderWindow"
        WindowStartupLocation="CenterScreen"
        ResizeMode="NoResize"
        ShowInTaskbar="False">
    <Window.Resources>
        <ui:True2VisibleConverter x:Key="true2Visible"/>
        <ui:True2HiddenConverter x:Key="true2Hidden"/>
        <ui:True2FalseConverter x:Key="true2False"/>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid Grid.Column="0" Name="_ctlControlPanel">
            <Grid.RowDefinitions>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>

            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center" IsEnabled="{Binding Path=IsAutoPlay, Converter={StaticResource true2False}}">
                <Button x:Name="btn_UnderControl" Click="btn_UnderControl_Click" Content="接受控制"  Margin="5" Width="100"
                    IsEnabled="{Binding Path=IsUnderControl, Converter={StaticResource true2False}}"/>
                <Button x:Name="btn_OutofControl" Click="btn_OutofControl_Click" Content="脱离控制"  Margin="5" Width="100"
                    IsEnabled="{Binding Path=IsUnderControl}"/>
            </StackPanel>
            <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center" IsEnabled="{Binding Path=IsUnderControl, Converter={StaticResource true2False}}">
                <Button x:Name="btn_BeginAutoPlay" Click="btn_BeginAutoPlay_Click" Content="自动播放"  Margin="5" Width="100"
                    IsEnabled="{Binding Path=IsAutoPlay, Converter={StaticResource true2False}}"/>
                <Button x:Name="btn_StopAutoPlay" Click="btn_StopAutoPlay_Click" Content="停止播放"  Margin="5" Width="100"
                    IsEnabled="{Binding Path=IsAutoPlay}"/>
            </StackPanel>
            <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" >
                <Button x:Name="btn_BeginFullScreen" Click="btn_BeginFullScreen_Click" Content="开始全屏"  Margin="5" Width="100"
                    IsEnabled="{Binding Path=IsFullScreen, Converter={StaticResource true2False}}"/>
                <Button x:Name="btn_StopFullScreen" Click="btn_StopFullScreen_Click" Content="退出全屏" Margin="5" Width="100"
                    IsEnabled="{Binding Path=IsFullScreen}"/>
            </StackPanel>
            <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center">
                <Button x:Name="_ctlBtnDeleteDataCache" Click="OnBtnDeleteDataCacheClick" Content="删除数据缓存" Margin="5" Width="200"></Button>
            </StackPanel>
            <StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Center">
                <Button x:Name="btn_Quit" Click="btn_Quit_Click" Content="退出程序" Margin="5" Width="200"></Button>
            </StackPanel>
        </Grid>
        <Grid Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <TextBlock Name="_ctlTextNetState" Text="-" Grid.Row="0"/>
            <DataGrid x:Name="dataGridProxyState" AutoGenerateColumns="False" IsReadOnly="True" Grid.Row="1">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="服务地址" Width="80" Binding="{Binding IP, Mode=OneWay}"/>
                    <DataGridTextColumn Header="端口" Width="40" Binding="{Binding Port, Mode=OneWay}"/>
                    <DataGridCheckBoxColumn Header="是否连接" Width="80" Binding="{Binding IsConnected, Mode=OneWay}"/>
                </DataGrid.Columns>
            </DataGrid>
        </Grid>
    </Grid>
</Window>
